<template>
 <div class="fix-page">
        <div id="login" class="place">
        <headerNav :isShowBack="true" title="忘记密码"></headerNav>
        <div class="a"><a href=""></a></div>
        <div class="title">
            <h1>忘记密码？</h1>
            <p class="p1">请输入手机号码以获取登录帮助</p >
        </div>
        <div class="phone-num">
            <p class="phone">手机号码</p><br>
            <input type="text" name="" value="+86" class="text1" readonly="true">&nbsp;&nbsp;
            <input v-model="phone" class="num" type="text" maxlength="11"><br><br>
            <input @click="sendCode" class="yzm" type="button" value="发送验证码" ><br><br>
        </div>
    </div>
 </div>
</template>

<script>
    import {getSmsCode} from 'network/index'
    import headerNav from 'components/HeaderNav/headerNav'
    export default {
        name: "forget_pwd",
        components:{
            headerNav
        },
        data(){
            return{
                phone:""
            }
        },
        methods:{
            sendCode(){
                const phoneReg = /^1[3456789]\d{9}$/;
                if(!phoneReg.test(this.phone)){
                    this.$toast({
                        message: '请输入正确的手机信息',
                        type:"fail"
                    });
                    return
                }
                getSmsCode({
                    phone: this.phone
                }).then(res=>{
                    console.log(res);
                }).catch(err=>{

                })
                this.$router.push('/input_scode')
            }
        }
    }
</script>

<style scoped>
 .fix-page{
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background: #fff;
        z-index: 777;
    }
    .fix-page .place{
        overflow: auto;
        height: 100%;
    }
  .text2{
      text-align: center;
      margin-top: 100px;

    }
   #login{
       padding: 0 20px 80px;
   }
  .num{
      background:transparent;
      border:none;
      border-bottom: 1px solid #ccc;
      height: 40px;
      width: 200px;
  }
  .yzm{
      height: 50px;
      width: 100%;
      border: none;
      text-align: center;
      background-color: rgb(0, 138, 133);
      border-radius:8px;
      color:rgb(255, 255, 255);
  }
  .foot{
      font-size: 13px;
      margin-right: 20px;
      text-align: center;
      margin-top: 30px;
      bottom: 55px;
  }
  .phone{
      margin-top: 80px;
  }
  .left{
      margin-top: 16px;
      color: rgb(0, 138, 133);
  }
  .p1{
      margin-top: 10px;
  }
  .text1{
      height:40px;
      width:50px;
      text-align: center;
  }
</style>